package com.repast.service.impl;

import java.util.List;

import com.repast.common.Const;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.repast.common.ServerResponse;
import com.repast.dao.FoodsMapper;
import com.repast.dao.FoodsTypeMapper;
import com.repast.pojo.Foods;
import com.repast.pojo.FoodsType;
import com.repast.service.IFoodsTypeService;

@Service
public class FoodsTypeServiceImpl implements IFoodsTypeService {
	
	@Autowired
	private FoodsTypeMapper foodsTypeMapper;
	
	public ServerResponse selectFoodsTypeList(){
		//只查询上架的菜品
		List<FoodsType> foodsTypeList = foodsTypeMapper.selectFoodsTypeList();
		if(foodsTypeList.size()==0){
			return ServerResponse.createBySuccessMessage("当前还没有任何品类");
		}
		return ServerResponse.createBySuccess(foodsTypeList);
	}
}
